<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>3D Boxes</title>
		<style>
			.box {
				position: relative;
				width: 100px;
				height: 100px;
				margin: 50px auto;
				transform-style: preserve-3d;
				animation: rotate 3s linear infinite;
			}

			.box div {
				position: absolute;
				width: 100%;
				height: 100%;
				background: rgba(0, 0, 0, 0.5);
				box-sizing: border-box;
				border: 1px solid #fff;
			}

			.box div:nth-of-type(1) {
				transform: rotateY(0deg) translateZ(50px);
			}

			.box div:nth-of-type(2) {
				transform: rotateX(90deg) translateZ(50px);
			}

			.box div:nth-of-type(3) {
				transform: rotateY(90deg) translateZ(50px);
			}

			@keyframes rotate {
				from {
					transform: rotateY(0deg);
				}

				to {
					transform: rotateY(360deg);
				}
			}
		</style>
	</head>
	<body>
		<h1>github有趣的html代码-3D立体效果-https://www.yzktw.com.cn/post/1070185.html</h1>
		<div class="box">
			<div></div>
			<div></div>
			<div></div>
		</div>
	</body>
</html>